package com.ruoyi.gather.api;

import com.ruoyi.common.core.constant.ServiceNameConstants;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.gather.api.domain.ErpSellerStoreProduct;
import com.ruoyi.gather.api.domain.ErpSellerStoreProductExpand;
import com.ruoyi.gather.api.domain.ErpSellerStoreProductSku;
import com.ruoyi.gather.api.domain.dto.PublishInnerAuthDto;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;


@FeignClient(contextId = "remoteSellerStoreProductService", value = ServiceNameConstants.GATHER_SERVICE)
public interface RemoteSellerStoreProductService {

    /**
     * 通过id获取在线库产品信息
     */
    @GetMapping("/seller/sellerStoreProduct/getSellerStoreProductInfoById/{id}}")
    public R<Object> getSellerStoreProductInfoById(@PathVariable("id") String id);

    @PostMapping("/seller/sellerStoreProduct/getSellerStoreProductInfo")
    R<Object> getSellerStoreProductInfo(@RequestBody ErpSellerStoreProduct sellerStoreProduct);

    @PostMapping("/seller/sellerStoreProduct/deleteErpSellerStoreProduct")
    R<Object> deleteErpSellerStoreProduct(@RequestBody ErpSellerStoreProduct sellerStoreProduct);

    @PostMapping("/seller/sellerStoreProduct/publishInnerAuth")
    R<Object> publishInnerAuth(@RequestBody PublishInnerAuthDto dto);

    //在线商品表延伸表相关
    @PostMapping("/seller/sellerStoreProductExpand/updateErpSellerStoreProductExpand")
    R<Object> updateErpSellerStoreProductExpand(@RequestBody ErpSellerStoreProductExpand erpSellerStoreProductExpand);

    @PostMapping("/seller/sellerStoreProductExpand/getErpSellerStoreProductExpandInfo")
    R<Object> getErpSellerStoreProductExpandInfo(@RequestBody ErpSellerStoreProductExpand sellerStoreProductExpand);

    @PostMapping("/seller/sellerStoreProductExpand/deleteErpSellerStoreProductExpand")
    R<Object> deleteErpSellerStoreProductExpand(@RequestBody ErpSellerStoreProductExpand sellerStoreProductExpand);

    //在线商品表SKU表相关
    @PostMapping("/seller/sellerStoreProductSku/getSellerStoreProductSkuListInfo")
    R<Object> getSellerStoreProductSkuListInfo(@RequestBody ErpSellerStoreProductSku erpSellerStoreProductSku);

    @PostMapping("/seller/sellerStoreProductSku/deletErpSellerStoreProductSkuList")
    void deletErpSellerStoreProductSkuList(@RequestBody List<ErpSellerStoreProductSku> erpSellerStoreProductSkuList);

    @GetMapping("/seller/sellerStoreProduct/confirmUploadSuccess/{sellerStoreProductId}")
    void confirmUploadSuccess(@PathVariable("sellerStoreProductId") Long sellerStoreProductId);


    @PostMapping("/seller/sellerStoreProduct/pushInnerAuth/{sellerStoreProductId}")
    R<Object> pushInnerAuth(@PathVariable("sellerStoreProductId") Long sellerStoreProductId);

    @GetMapping("/seller/sellerStoreProductSku/getSellerStoreSkuAttr/{id}")
    R<Object> getSellerStoreSkuAttr(@PathVariable("id") Long id);

    @GetMapping("/seller/sellerStoreProductSku/getSkuById")
    ErpSellerStoreProductSku getSkuById(@RequestParam("id") Long id);

    @PostMapping("/seller/sellerStoreProductExpand/updateModuleCount")
    void updateModuleCount(List<Long> list);

    @GetMapping("/seller/sellerStoreProduct/selectRepeatProduct/{storeUserName}/{collectProductId}")
    R<Object> selectRepeatProduct(@PathVariable("storeUserName")String storeUserName, @PathVariable("collectProductId")Long collectProductId);

    /**
     * 根据店铺ID，获取店铺未下架商品数量
     * @param storeId
     * @return
     */
    @GetMapping("/seller/sellerStoreProduct/getProductCountByStoreId")
    R<Object> getProductCountByStoreId(@RequestParam("storeId") String storeId);

    @GetMapping("/seller/sellerStoreProduct/getProductByCycle/{cycle}/{storeIds}")
    R<Object> getProductByCycle(@PathVariable("cycle") String cycle, @PathVariable("storeIds") String storeIds);

    /**
     * 根据店铺cn码获取第一条产品
     */
    @GetMapping("/seller/sellerStoreProduct/getFarthestProduct")
    ErpSellerStoreProduct getFarthestProduct(@RequestParam("storeUserName") String storeUserName);
}
